<!DOCTYPE html>
<html lang="en" class="page-fill" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>运单录入</title>
    <meta name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/css/oksub.css">
    <script type="text/javascript" src="/lib/loading/okLoading.js"></script>
</head>
<body>
<input type="hidden" id="edit">
<div class="ok-body">

    <form class="layui-form" lay-filter="filter">

        <div class="layui-form-item">
            <div class="layui-input-block">

                <button class="layui-btn" lay-submit lay-filter="edit">
                    <i class="layui-icon">&#xe605;</i>提交运单
                </button>

            </div>
        </div>

        <div class="layui-fluid" id="LAY-component-grid-stack">
            <div class="layui-row layui-col-space10">
                <!-- 基本信息模块 -->
                <div class="layui-col-md12">
                    <div class="layui-card">
                        <div class="layui-card-header"
                             style="background-color: #eeeeee;font-size:14px;line-height: 36px; font-weight:600;height:35px;border-bottom: 1px solid #e6e6e6;">
                            基本信息
                        </div>
                        <div class="layui-card-body" style="padding:10px 0px;">

                            <div class="layui-inline" style="margin-bottom:10px">
                                <label class="layui-form-label">运单编号：</label>
                                <div class="layui-inline">
                                    <input style="width:146px;" type="text" id="waybillId" name="waybillId"
                                           autocomplete="off" placeholder="请输入运单编号" class="layui-input"
                                           required="required"><!--readonly="readonly"-->
                                </div>
                            </div>

                            <!--  寄件区间-->
                            <div class="layui-inline" style="margin-bottom:10px">
                                <label class="layui-form-label">寄件区间：</label>
                                <div class="layui-inline">
                                    <select name="sendingId" id="sendingId" class="layui-select" lay-filter="sendingId"
                                            lay-verify="required" lay-search="true">
                                        <option value="">请选择寄件区间</option>
                                        <option th:each="s:${sending}" th:value="${s.id}" th:text="${s.rangeName}"/>
                                    </select>

                                    <!--  <input id="desname" onclick="desClick();" style="width:146px;" type="text" autocomplete="off" placeholder="请选择" class="layui-input">  -->
                                </div>
                            </div>

                            <!--  目的区间 -->
                            <div class="layui-inline" style="margin-bottom:10px">
                                <label class="layui-form-label">目的区间：</label>
                                <div class="layui-inline">
                                    <select name="destId" id="destId" class="layui-select" lay-filter="destId"
                                            lay-verify="required" lay-search="true">
                                        <option value="">请选择目的区间</option>
                                        <option th:each="spot:${spots}" th:value="${spot.id}"
                                                th:text="${spot.rangeName}"/>
                                    </select>

                                    <!--  <input id="desname" onclick="desClick();" style="width:146px;" type="text" autocomplete="off" placeholder="请选择" class="layui-input">  -->
                                </div>
                            </div>

                            <!-- 目的地 -->
                            <div class="layui-inline" style="margin-bottom:10px">
                                <label class="layui-form-label">目的地：</label>
                                <div class="layui-inline">
                                    <select name="destinationId" id="destinationId" class="layui-select"
                                            lay-filter="destinationId" lay-verify="required" lay-search="true">
                                        <option value="">请选择目的地</option>
                                        <option th:each="dest:${destinations}" th:value="${dest.id}"
                                                th:text="${dest.name}"/>
                                    </select>

                                    <!--  <input id="desname" onclick="desClick();" style="width:146px;" type="text" autocomplete="off" placeholder="请选择" class="layui-input">  -->
                                </div>
                            </div>


                            <div class="layui-inline" style="margin-bottom:10px">
                                <label class="layui-form-label">取件员：</label>
                                <div class="layui-inline" style=" width: 146px; margin-bottom:10px;">
                                    <select name="takerId" class="layui-select" lay-filter="takerId"
                                            lay-verify="required" lay-search="true">
                                        <option value="">请选择取件员</option>
                                        <option th:each="pickup:${pickups}" th:value="${pickup.staffId}"
                                                th:text="${pickup.name}"/>
                                    </select>

                                    <!--  <input id="wname" onclick="workerClick();" style="width:146px;" type="text" autocomplete="off" placehhttp:="" desktop-r8lfpsi:8080="" hyuu="" worker="" logoutolder="请选择" class="layui-input">  -->
                                </div>
                            </div>

                            <div class="layui-inline" style="margin-bottom:10px">
                                <label class="layui-form-label">寄件时间：</label>
                                <div class="layui-inline">
                                    <input name="sendTime" type="text" class="layui-input" id="sendTime" lay-key="1">
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label">快件类型：</label>
                                <div class="layui-inline" style=" width: 146px;margin-bottom:10px;">
                                    <select name="expressTypeId" id="expressTypeId" class="layui-select"
                                            lay-filter="expressTypeId" lay-verify="required" lay-search="true">
                                        <option value="">请选择快件类型</option>
                                        <option th:each="shift:${shifts}" th:value="${shift.dictId}"
                                                th:text="${shift.dictItemName}"/>
                                    </select>
                                </div>
                            </div>
                            <!-- 运输方式 -->
                            <div class="layui-inline">
                                <label class="layui-form-label">运输方式：</label>
                                <div class="layui-inline" style="margin-bottom:10px;">
                                    <select name="transportMethodId" class="layui-select" lay-filter="transportMethodId"
                                            lay-verify="required" lay-search="true">
                                        <option value="">请选择运输方式</option>
                                        <option th:each="transport:${transports}" th:value="${transport.dictId}"
                                                th:text="${transport.dictItemName}"/>
                                    </select>

                                </div>
                            </div>
                            <!-- 承运商

                            <div class="layui-inline">
                                <label class="layui-form-label">承运商：</label>
                                <div class="layui-inline" style=" width: 146px; margin-bottom:10px;">
                                    <select name="agentWaybillNumber" class="layui-select"
                                            lay-filter="agentWaybillNumber" lay-verify="required" lay-search="true">
                                        <option value="">请选择承运商</option>
                                        <option th:each="company:${companies}" th:value="${company.expressCompanyId}"
                                                th:text="${company.expressCompanyName}"/>
                                    </select>
                                </div>
                            </div>-->
                            <!-- 转出单号

                            <div class="layui-inline" style="margin-bottom:10px;">
                                <label class="layui-form-label">转出单号：</label>
                                <div class="layui-inline" style="">
                                    <input type="text" name="agent_waybill_number" id="agent_waybill_number"
                                           autocomplete="off" placeholder="请输入" class="layui-input">
                                </div>
                            </div>
                            -->


                            <div class="layui-inline" style="margin-bottom:10px">
                                <label class="layui-form-label">目的网点：</label>
                                <div class="layui-inline">
                                    <select name="transportNetworkId" class="layui-select"
                                            lay-filter="transportNetworkId" lay-verify="required" lay-search="true">
                                        <option value="">请选择目的网点</option>
                                        <option th:each="network:${networks}" th:value="${network.networkId}"
                                                th:text="${network.networkName}"/>
                                    </select>
                                </div>
                            </div>
                        </div>

                        <!--  寄件人信息模块 -->
                        <div class="layui-col-md6">
                            <div class="layui-card">
                                <div class="layui-card-header"
                                     style="background-color: #eeeeee;font-size:14px;line-height: 36px; font-weight:600;height:35px;border-bottom: 1px solid #e6e6e6;">
                                    寄件信息
                                </div>
                                <div class="layui-card-body" style="padding:10px 0px;">
                                    <label class="layui-form-label">高级客户：</label>
                                    <div class="layui-inline" style="margin-bottom: 10px ; width:180px;">
                                        <select name="vipId" id="vipId" class="layui-select" lay-filter="vipId"
                                                lay-verify="required" lay-search="true">
                                            <option value="">请选择高级客户</option>
                                            <option th:each="customer:${customers}" th:value="${customer.clientId}"
                                                    th:text="${customer.clientName}"/>
                                        </select>

                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">寄件人：</label>
                                        <div class="layui-input-block" style=" position: relative;width:180px;">
                                            <input style="width:150px;" type="text" id="senderName" name="senderName"
                                                   autocomplete="off" placeholder="请输入" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">手机：</label>
                                        <div class="layui-input-block">
                                            <input style="width:150px;" type="text" lay-filter="senderPhonenumber"
                                                   lay-verify="phone" id="senderPhonenumber" name="senderPhonenumber"
                                                   autocomplete="off" placeholder="请输入" class="layui-input">
                                            <div class="layui-form-autocomplete">
                                                <dl class="layui-anim layui-anim-upbit"></dl>
                                            </div>

                                        </div>
                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">身份证：</label>
                                        <div class="layui-input-block" style="width:215px;">
                                            <input type="text" id="senderIdcard" name="senderIdcard" autocomplete="off"
                                                   placeholder="请输入" class="layui-input" lay-filter="identity"
                                                   lay-verify="senderIdcard">
                                        </div>
                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">邮编：</label>
                                        <div class="layui-input-block" style="">
                                            <input style="width:150px;" type="text" id="senderPost" name="senderPost"
                                                   lay-verify="required" autocomplete="off" placeholder="请输入"
                                                   class="layui-input" lay-filter="senderPost">
                                        </div>
                                    </div>

                                    <div class="layui-form-item" id="area-picker">
                                        <div class="layui-form-label">省份：</div>
                                        <div class="layui-input-inline" style="width: 300px;">
                                            <select name="sendProvince" class="province-selector"
                                                    lay-filter="sendProvince" lay-verify="required" lay-search="true">
                                                <option value="">请选择省</option>
                                            </select>
                                        </div>
                                        <div class="layui-form-label">城市：</div>
                                        <div class="layui-input-inline" style="width: 300px;">
                                            <select name="sendCity" class="city-selector" lay-filter="sendCity"
                                                    lay-verify="required" lay-search="true">
                                                <option value="">请选择市</option>
                                            </select>
                                        </div>
                                        <div class="layui-form-label">区域：</div>
                                        <div class="layui-input-inline" style="width: 300px;">
                                            <select name="sendArea" class="county-selector" lay-filter="sendArea"
                                                    lay-verify="required" lay-search="true">
                                                <option value="">请选择区</option>
                                            </select>
                                        </div>
                                    </div>

                                    <br>
                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">详细地址：</label>
                                        <div class="layui-input-block">
                                            <div style="display:flex;align-items: center;">
                                                <input style="width:300px;" id="address" type="text"
                                                       name="address" autocomplete="off" placeholder="请输入"
                                                       class="layui-input">
                                            </div>
                                        </div>
                                    </div>


                                </div>
                            </div>
                        </div>

                        <!-- 收件人信息模块 -->
                        <div class="layui-col-md6">
                            <div class="layui-card">
                                <div class="layui-card-header"
                                     style="background-color: #eeeeee;font-size:14px;line-height: 36px; font-weight:600;height:35px;border-bottom: 1px solid #e6e6e6;">
                                    收件信息
                                </div>
                                <div class="layui-card-body" style="padding:10px 0px;">
                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">收件人：</label>
                                        <div class="layui-input-block" style="">
                                            <input style="width:150px;" type="text" id="recipient" name="recipient"
                                                   autocomplete="off" placeholder="请输入" class="layui-input">
                                            <div class="layui-form-autocomplete">
                                                <dl class="layui-anim layui-anim-upbit"></dl>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">手机：</label>
                                        <div class="layui-input-block" style="">
                                            <input style="width:150px;" id="recipientPhonenumber" type="text"
                                                   lay-verify="phone" name="recipientPhonenumber" autocomplete="off"
                                                   placeholder="请输入" class="layui-input">
                                            <div class="layui-form-autocomplete">
                                                <dl class="layui-anim layui-anim-upbit"></dl>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">公司：</label>
                                        <div class="layui-input-block" style="">
                                            <input style="width:150px;" id="recipientCompany" type="text"
                                                   name="recipientCompany" autocomplete="off" placeholder="请输入"
                                                   class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">身份证号：</label>
                                        <div class="layui-input-block" style="">
                                            <input style="width:150px;" id="recipientIdcard" type="text"
                                                   lay-verify="identity" name="recipientIdcard" autocomplete="off"
                                                   placeholder="请输入" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">邮编：</label>
                                        <div class="layui-input-block" style="">
                                            <input style="width:150px;" type="text" id="recipientPostcode"
                                                   lay-verify="required" name="recipientPostcode" autocomplete="off"
                                                   placeholder="请输入" class="layui-input">
                                        </div>
                                    </div>
                                    <br>

                                    <div class="layui-form-item" id="area2">
                                        <div class="layui-form-label">省份：</div>
                                        <div class="layui-input-inline" style="width: 300px;">
                                            <select name="recipientProvince" class="province-selector"
                                                    lay-filter="recipientProvince" lay-verify="required"
                                                    lay-search="true">
                                                <option value="">请选择省</option>
                                            </select>
                                        </div>
                                        <div class="layui-form-label">城市：</div>
                                        <div class="layui-input-inline" style="width: 300px;">
                                            <select name="recipientCity" class="city-selector"
                                                    lay-filter="recipientCity" lay-verify="required" lay-search="true">
                                                <option value="">请选择市</option>
                                            </select>
                                        </div>
                                        <div class="layui-form-label">区域：</div>
                                        <div class="layui-input-inline" style="width: 300px;">
                                            <select name="recipientArea" class="county-selector"
                                                    lay-filter="recipientArea" lay-verify="required" lay-search="true">
                                                <option value="">请选择区</option>
                                            </select>
                                        </div>
                                    </div>

                                    <br>
                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">详细地址：</label>
                                        <div class="layui-input-block" style="">
                                            <input style="width:300px;" id="recipientAddress" type="text"
                                                   name="recipientAddress" autocomplete="off" placeholder="请输入"
                                                   class="layui-input">
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>
                        <!-- 物品信息模块 -->
                        <div class="layui-col-md6">
                            <div class="layui-card">
                                <div class="layui-card-header"
                                     style="background-color: #eeeeee;font-size:14px;line-height: 36px; font-weight:600;height:35px;border-bottom: 1px solid #e6e6e6;">
                                    物品信息
                                </div>
                                <div class="layui-card-body" style="padding:10px 0px;">

                                    <div class="layui-inline">
                                        <label class="layui-form-label">物品类型：</label>
                                        <div class="layui-inline" style=" width: 150px;margin-bottom:10px;">
                                            <select name="itemTypeId" id="itemTypeId" class="layui-select"
                                                    lay-filter="itemTypeId" lay-verify="required" lay-search="true">
                                                <option value="">请选择物品类型</option>
                                                <option th:each="product:${products}" th:value="${product.dictId}"
                                                        th:text="${product.dictItemName}"/>
                                            </select>
                                        </div>
                                    </div>
                                    <!-- </form> -->

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">物品名称：</label>
                                        <div class="layui-input-block" style="">
                                            <input style="width:150px;" type="text" id="itemName" name="itemName"
                                                   autocomplete="off" placeholder="请输入" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">件数：</label>
                                        <div class="layui-input-block" style="">
                                            <input style="width:150px;" id="number" lay-verify="positiveInteger"
                                                   type="number" name="number" autocomplete="off" placeholder="请输入"
                                                   class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">重量/kg：</label>
                                        <div class="layui-input-block" style="">
                                            <input id="weight" style="width:150px;" lay-verify="positiveNumber"
                                                   type="text" name="weight" autocomplete="off" placeholder="请输入"
                                                   class="layui-input">
                                        </div>
                                    </div>

                                    <!--
                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">长*宽*高：</label>
                                        <div class="layui-input-block" style="display:flex;">
                                            <input id="long" style="width:50px;padding-left:4px;" type="number" name="protectionprice" autocomplete="off" class="layui-input"> <input style="width:50px;padding-left:4px;" id="wide" type="number" name="fuwu" autocomplete="off" class="layui-input"> <input id="high" style="width:50px;padding-left:4px;" type="number" name="otherprice" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    -->

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">体积：</label>
                                        <div class="layui-input-block">
                                            <input id="volume" style="width:150px;" type="number"
                                                   lay-verify="positiveNumber" name="volume" autocomplete="off"
                                                   placeholder="请输入" class="layui-input">
                                        </div>
                                    </div>

                                    <!--<div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">回单号：</label>
                                        <div class="layui-input-block" style="">
                                            <input id="returnOrderNum" style="width:150px;" type="text" name="returnOrderNum" autocomplete="off" placeholder="请输入" class="layui-input">
                                        </div>
                                    </div>
                                    -->
                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">备注：</label>
                                        <div class="layui-input-block" style="">
                                            <input id="remarks" style="width:384px;" type="text" name="remarks"
                                                   autocomplete="off" placeholder="请输入" class="layui-input">
                                        </div>
                                    </div>
                                    <!--	</form> -->

                                </div>
                            </div>
                        </div>
                        <!-- 费用信息模块 -->
                        <div class="layui-col-md6">
                            <div class="layui-card">
                                <div class="layui-card-header"
                                     style="background-color: #eeeeee;font-size:14px;line-height: 36px; font-weight:600;height:35px;border-bottom: 1px solid #e6e6e6;">
                                    费用信息
                                </div>
                                <div class="layui-card-body" style="padding:10px 0px;">
                                    <div class="layui-inline" style="margin-bottom:10px;">
                                        <label class="layui-form-label">付款方式：</label>
                                        <div class="layui-inline" style="width: 150px">
                                            <select name="paymentMethodId" class="layui-select"
                                                    lay-filter="paymentMethodId" lay-verify="required"
                                                    lay-search="true">
                                                <option value="">请选择付款方式</option>
                                                <option th:each="payment:${payments}" th:value="${payment.dictId}"
                                                        th:text="${payment.dictItemName}"/>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">保价费：</label>
                                        <div class="layui-input-block" style="">
                                            <input id="insuranceCharge" style="width:150px;" lay-verify="positiveNumber"
                                                   type="number" name="insuranceCharge" autocomplete="off"
                                                   placeholder="请输入" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">服务费：</label>
                                        <div class="layui-input-block" style="">
                                            <input style="width:150px;" type="number" id="serviceCharge"
                                                   lay-verify="positiveNumber" name="serviceCharge" autocomplete="off"
                                                   placeholder="请输入" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">其他费用：</label>
                                        <div class="layui-input-block" style="">
                                            <input id="otherCharge" style="width:150px;" type="number"
                                                   lay-verify="positiveNumber" name="otherCharge" autocomplete="off"
                                                   placeholder="请输入" class="layui-input">
                                        </div>
                                    </div>

                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">代收货款：</label>
                                        <div class="layui-input-block" style="">
                                            <input style="width:150px;" id="collectionOnDelivery" type="number"
                                                   lay-verify="positiveNumber" name="collectionOnDelivery"
                                                   autocomplete="off" placeholder="请输入" class="layui-input">
                                        </div>
                                    </div>

                                    <!--
                                    <div class="layui-inline" style="margin-bottom:10px">
                                        <label class="layui-form-label">贷款信息：</label>
                                        <div class="layui-input-block" style="">
                                            <input style="width:150px;" type="text" onclick="bank()" name="ordernum" autocomplete="off" id="dkxx_bank" placeholder="请输入" class="layui-input">
                                        </div>
                                    </div>
                                     -->

                                    <div class="layui-inline" style="">
                                        <label class="layui-form-label">运费：</label>
                                        <div class="layui-input-block">
                                            <div class="layui-inline">
                                                <input style="width:80px;" type="number" lay-verify="positiveNumber"
                                                       id="freight" name="freight" autocomplete="off" placeholder="请输入"
                                                       class="layui-input" readonly="readonly">
                                            </div>
                                            <div class="layui-inline">
                                                <input class="layui-btn" type="button" id="total" name="total"
                                                       style="height:33px;line-height: 33px;width: 67px" value="报价"/>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="layui-inline">
                                        <div style="display:flex;margin-left:30px; font-size: 18px;font-weight: bold;">
                                            <label style="padding-top:10px;color:red">总金额：</label>
                                            <div class="layui-input-block" name="count"
                                                 style="margin-left: 0px;padding-top: 7px;font-size:20px;color:#ff81bd;margin-top:4px;">
                                                <input style="width:80px;" type="number" lay-verify="required"
                                                       id="totalMoney" name="totalMoney" autocomplete="off"
                                                       class="layui-input" readonly="readonly">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</div>

<!--js逻辑-->
<script src="/lib/layui/layui.js"></script>
<script>
    //配置插件目录
    layui.config({
        base: '/lib/mods/'
        , version: '1.0'
    });
    //一般直接写在一个js文件中
    layui.use(['layer', 'form', 'layarea', 'jquery'], function () {
        var layer = layui.layer
            , form = layui.form
            , layarea = layui.layarea;
        $ = layui.jquery;

        layarea.render({
            elem: '#area-picker',
            change: function (res) {
                //选择结果
                console.log(res);
            }
        });
        layarea.render({
            elem: '#area2',
            change: function (res) {
                //选择结果
                console.log(res);
            }
        });

        var edit = $("#edit").val();
        console.log(JSON.stringify(edit));
        if (edit != null && edit != undefined && edit != "") {
            edit = JSON.parse($("#edit").val());
        }
        //表单赋值
        form.val("filter", edit);
    });


    layui.use(["element", "form", "laydate", "okLayer", "okUtils", "jquery", "upload"], function () {

        var form = layui.form;
        var laydate = layui.laydate;
        var okLayer = layui.okLayer;
        var okUtils = layui.okUtils;
        var upload = layui.upload;
        var layer = parent.layer === undefined ? layui.layer : parent.layer;
        var $ = layui.jquery;
        okLoading.close();


        laydate.render({
            elem: '#sendTime' //指定元素
            , type: 'datetime'
        });


        form.verify({
            positiveInteger: [
                /^[1-9]\d*$/
                , '必须为正整数'
            ]
            //我们既支持上述函数式的方式，也支持下述数组的形式
            //数组的两个值分别代表：[正则匹配、匹配不符时的提示文字]
            , positiveNumber: [
                /^(0|[1-9][0-9]*)(\.\d+)?$/
                , '必须为正数'
            ]
        });

        // 添加单号事件
        $("#increase").click(function () {

            $.post("/api/waybill/increase", function (data, status) {
                // 成功的回调函数，解析结果
                if (status != 'success') {
                    // 未查询到所需要的对应解析方法，按照默认方法执行
                    // var formula = insuranceCharge + serviceCharge + otherCharge;
                    console.info("失败：" + data + "状态：" + status);

                } else {
                    console.info("成功：" + data + "状态：" + status);
                }
            })
        })
        // 提交运单事件
        form.on("submit(edit)", function (data) {
            okUtils.ajax("/api/waybill/update", "post", data.field, true).done(function (response) {
                console.log(response);
                okLayer.greenTickMsg("修改成功", function () {
                    parent.layer.close(parent.layer.getFrameIndex(window.name));
                    layer.close(layer.index);
                });
            }).fail(function (error) {
                console.log(error)
            });
            return false;
        });
        // 打印运单事件
        $("#printing").click(function () {

            $.post("/page/waybill/printing", function (data, status) {
                // 成功的回调函数，解析结果
                if (status != 'success') {
                    // 未查询到所需要的对应解析方法，按照默认方法执行
                    // var formula = insuranceCharge + serviceCharge + otherCharge;
                    console.info("失败：" + data + "状态：" + status);

                } else {
                    console.info("成功：" + data + "状态：" + status);
                }
            })
        })

        // 高级客户选中后回填信息事件

        // 报价事件
        $("#total").click(function () {
            console.log("开始");
            // 所需判断条件信息
            var send = $("#sendingId").val();
            var destination = $("#destId").val();
            var shift = $("#expressTypeId").val();
            var itemType = $("#itemTypeId").val();
            var vip = $("#vipId").val();
            var weights = $("#weight").val();

            // 执行时所需信息
            var insuranceCharge = $("#insuranceCharge").val();
            var serviceCharge = $("#serviceCharge").val();
            var otherCharge = $("#otherCharge").val();

            if (destination == '' || shift == '' || itemType == '' || send == '' || weights == '' || insuranceCharge == '' || serviceCharge == '' || otherCharge == '') {
                layer.open({
                    title: '信息提示'
                    , content: '重要信息不能为空'
                });
            } else {
                $.post("/api/waybill/quote", {
                    "send": send,
                    "destination": destination,
                    "shift": shift,
                    "itemType": itemType,
                    "vip": vip
                }, function (data, status) {
                    var W = eval(weights);
                    var I = eval(insuranceCharge);
                    var S = eval(serviceCharge);
                    var O = eval(otherCharge);
                    // 成功的回调函数，解析结果
                    if (data.code != 0) {
                        // 未查询到所需要的对应解析方法，按照默认方法执行
                        // var formula = insuranceCharge + serviceCharge + otherCharge;
                        console.info("失败：" + data + "状态：" + status);
                        var formula = eval(insuranceCharge) + eval(serviceCharge) + eval(otherCharge);
                        console.log("formula==" + formula);
                        //$("#freight").attr("value", ""+formula);
                        $("#freight").val(formula);
                        var f = formula + W;
                        console.log("totalMoney==" + f);
                        // $("#totalMoney").attr("value", f);
                        $("#totalMoney").val(f);
                        // eval();
                    } else {
                        console.info("成功：" + data + "状态：" + status);

                        for (var f in data.data) {
                            console.log(data.data[f][0]);
                            console.log(data.data[f][1]);
                            var f_condition = data.data[f][0];
                            var f_statement = data.data[f][1];
                            console.info("eval(f_condition)" + eval(f_condition));
                            if (eval(f_condition)) {
                                var implement = eval(f_statement);
                            }
                        }
                        var money = implement + I + S + O;
                        $("#freight").attr("value", implement);
                        $("#totalMoney").attr("value", money);
                    }
                })
            }
        })


    });
</script>
</body>
</html>